/**
 * 
 * @author Bruce Fu
 *
 */
public class CenterMassForce extends Force{
    /**
     * Calculate the force introduced by the center mass.
     */
    public CenterMassForce() {
        super(0,0);
    }

    public void setCenterMassForce(Mass myMass) {
        setDirection(Force.angleBetween(Global.getCanvasCenter(), myMass.getCenter()));
        setMagnitude(Global.getCenterMassMagnitude() * (Global.getCenterMassExponent() / Math.abs(Global.getCenterMassExponent())) / 
                Math.pow(Force.distanceBetween(Global.getCanvasCenter(), myMass.getCenter()), Math.abs(Global.getCenterMassExponent())));
    }
}
